#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

union test {
	int i;
	char a[2];
};

int check_endian(void)
{

	union test test;
	test.i = 0x12345678;

	return (test.a[0] == 0x78);
}

int main(int argc, char *argv[])
{

	union test test;	
	test.i = 0x12345678;

	printf("%#x\n", test.a[0]);
	printf("%#x\n", test.a[1]);

	test.a[0] = 0x38;
	test.a[1] = 0x39;

	printf("%#x\n", test.i);

	return 0;
}
